<!--{template common/header}-->
<script type="text/javascript">
	var strongpw = new Array();
	<!--{if $_G['setting']['strongpw']}-->
		<!--{loop $_G['setting']['strongpw'] $key $val}-->
		strongpw[$key] = $val;
		<!--{/loop}-->
	<!--{/if}-->
	var pwlength = <!--{if $_G['setting']['pwlength']}-->$_G['setting']['pwlength']<!--{else}-->0<!--{/if}-->;
</script>
<script type="text/javascript" src="{$this->setting[jspath]}register.js?{VERHASH}"></script>
<div id="pt" class="bm cl">
	<div class="z">
		<a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> <em>&rsaquo;</em>
		{lang dzapp_base:bind}
	</div>
</div>
<div id="ct" class="wp cl">
	<div class="nfl" id="main_succeed" style="display: none">
		<div class="f_c altw">
			<div class="alert_right">
				<p id="succeedmessage"></p>
				<p id="succeedlocation" class="alert_btnleft"></p>
				<p class="alert_btnleft"><a id="succeedmessage_href">{lang message_forward}</a></p>
			</div>
		</div>
	</div>
	<div class="mn">

<div class="bm" id="main_message">
	<div class="bm_h bbs" id="main_hnav">
		<h3 id="layer_reginfo_t" class="xs2">
			{lang dzapp_base:bind_account}
		</h3>
	</div>
	<div style="width: 760px; margin: 30px auto 0;">
		<strong class="xs2">Hi, $this->dzapp_account[2],</strong>
		<span class="xg2">{lang dzapp_base:welcome_connect}$_G[setting][bbname]</span>
	</div>
	<p id="returnmessage4"></p>
	<ul class="tb cl" style="width: 760px; margin: 30px auto 0;">
		<li id="bind_1" onclick="switch_bind(1)" class="a"><a href="javascript:;">{lang dzapp_base:new_account}</a></li>
		<li id="bind_2" onclick="switch_bind(2)"><a href="javascript:;">{lang dzapp_base:old_account}</a></li>
	</ul>
	<!--{if $this->showregisterform}-->
	<form method="post" autocomplete="off" name="register" id="registerform" enctype="multipart/form-data" onsubmit="checksubmit();return false;" action="plugin.php?id=dzapp_base&mod=bind">
		<div id="layer_reg" class="bm_c">
			<input type="hidden" name="regsubmit" value="yes" />
			<input type="hidden" name="formhash" value="{FORMHASH}" />
			<input type="hidden" name="referer" value="$dreferer" />
			<input type="hidden" name="activationauth" value="{if $_GET[action] == 'activation'}$activationauth{/if}" />
			<!--{if $_G['setting']['sendregisterurl']}-->
				<input type="hidden" name="hash" value="$_GET[hash]" />
			<!--{/if}-->
			<div class="mtw">
				<div id="reginfo_a">
					<!--{hook/register_top}-->
					<!--{if $sendurl}-->
						<div class="rfm">
							<table>
								<tr>
									<th><span class="rq">*</span><label for="{$this->setting['reginput']['email']}">{lang email}:</label></th>
									<td>
										<input type="text" id="{$this->setting['reginput']['email']}" name="$this->setting['reginput']['email']" autocomplete="off" size="25" tabindex="1" class="px" required /><br /><em id="emailmore">&nbsp;</em>
										<input type="hidden" name="handlekey" value="sendregister"/>
									</td>
									<td class="tipcol"><i id="tip_{$this->setting['reginput']['email']}" class="p_tip">{lang dzapp_base:register_email_tips}</i><kbd id="chk_{$this->setting['reginput']['email']}" class="p_chk"></kbd></td>
								</tr>
							</table>
							<table>
								<tr>
									<th>&nbsp;</th>
									<td class="tipwide">
										{lang register_validate_email_tips}
									</td>
								</tr>
							</table>
							<script type="text/javascript">
								function succeedhandle_sendregister(url, msg, values) {
									showDialog(msg, 'notice');
								}
							</script>
						</div>
					<!--{else}-->
						<!--{if $invite}-->
							<!--{if $invite['uid']}-->
							<div class="rfm">
								<table>
									<tr>
										<th>{lang register_from}:</th>
										<td><a href="home.php?mod=space&uid=$invite[uid]" target="_blank">$invite[username]</a></td>
									</tr>
								</table>
							</div>
							<!--{else}-->
							<div class="rfm">
								<table>
									<tr>
										<th><label for="invitecode">{lang dzapp_base:invite_code}:</label></th>
										<td>$_GET[invitecode]<input type="hidden" id="invitecode" name="invitecode" value="$_GET[invitecode]" /></td>
									</tr>
								</table>
							</div>
							<!--{eval $invitecode = 1;}-->
							<!--{/if}-->
						<!--{/if}-->

						<!--{if empty($invite) && $this->setting['regstatus'] == 2 && !$invitestatus}-->
						<div class="rfm">
							<table>
								<tr>
									<th><span class="rq">*</span><label for="invitecode">{lang dzapp_base:invite_code}:</label></th>
									<td><input type="text" id="invitecode" name="invitecode" autocomplete="off" size="25" onblur="checkinvite()" tabindex="1" class="px" required /><!--{if $this->setting['inviteconfig']['buyinvitecode'] && $this->setting['inviteconfig']['invitecodeprice'] && ($this->setting[ec_tenpay_bargainor] || $this->setting[ec_tenpay_opentrans_chnid] || $this->setting[ec_account])}--><p><a href="misc.php?mod=buyinvitecode" target="_blank" class="xi2">{lang register_buyinvitecode}</a></p><!--{/if}--></td>
									<td class="tipcol"><i id="tip_invitecode" class="p_tip"><!--{if $this->setting['inviteconfig']['invitecodeprompt']}-->$this->setting[inviteconfig][invitecodeprompt]<!--{/if}--></i><kbd id="chk_invitecode" class="p_chk"></kbd></td>
								</tr>
							</table>
						</div>
						<!--{eval $invitecode = 1;}-->
						<!--{/if}-->

						<!--{if $_GET[action] != 'activation'}-->
							<!--{if $_G[cache][plugin][dzapp_mobile]}-->
							<div class="rfm" id="tr_mobile">
								<table>
									<tr>
										<th><span class="rq">*</span><label for="mobile">{lang dzapp_mobile:mobile}:</label></th>
										<td>
											<input type="text" id="mobile" name="mobile" class="px" tabindex="1" autocomplete="off" size="25" maxlength="11" />
											<br />
											<button type="button" id="codebtn" name="codebtn" class="pn mtn" value="true" tabindex="1" onclick="get_code()"><strong>{lang dzapp_mobile:get_code}</strong></button>
										</td>
										<td class="tipcol"><i id="tip_mobile" class="p_tip">{lang dzapp_mobile:mobile_tip}</i><kbd id="chk_mobile" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<div class="rfm" id="tr_code">
								<table>
									<tr>
										<th><span class="rq">*</span><label for="code">{lang dzapp_mobile:code}:</label></th>
										<td><input type="text" id="code" name="code" class="px" tabindex="1" autocomplete="off" size="25" maxlength="11" /></td>
										<td class="tipcol"><i id="tip_code" class="p_tip"></i><kbd id="chk_code" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<input type="hidden" name="regtype" id="regtype" value="$_G[cache][plugin][dzapp_mobile][mobile]" />
							<!--{/if}-->
							<div class="rfm" id="tr_username">
								<table>
									<tr>
										<th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
										<td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" /></td>
										<td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang dzapp_base:register_username_tips}</i><kbd id="chk_{$this->setting['reginput']['username']}" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<div class="rfm" id="tr_password">
								<table>
									<tr>
										<th><span class="rq">*</span><label for="{$this->setting['reginput']['password']}">{lang dzapp_base:password}:</label></th>
										<td><input type="password" id="{$this->setting['reginput']['password']}" name="" size="25" tabindex="1" class="px" /></td>
										<td class="tipcol"><i id="tip_{$this->setting['reginput']['password']}" class="p_tip">{lang dzapp_base:register_password_tips}<!--{if $_G['setting']['pwlength']}-->, {lang dzapp_base:register_password_length_tips1} $_G['setting']['pwlength'] {lang dzapp_base:register_password_length_tips2}<!--{/if}--></i><kbd id="chk_{$this->setting['reginput']['password']}" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<div class="rfm" id="tr_password2">
								<table>
									<tr>
										<th><span class="rq">*</span><label for="{$this->setting['reginput']['password2']}">{lang dzapp_base:password_confirm}:</label></th>
										<td><input type="password" id="{$this->setting['reginput']['password2']}" name="" size="25" tabindex="1" value="" class="px" /></td>
										<td class="tipcol"><i id="tip_{$this->setting['reginput']['password2']}" class="p_tip">{lang dzapp_base:register_repassword_tips}</i><kbd id="chk_{$this->setting['reginput']['password2']}" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<div class="rfm" id="tr_email">
								<table>
									<tr>
										<th><!--{if !$_G['setting']['forgeemail']}--><span class="rq">*</span><!--{/if}--><label for="{$this->setting['reginput']['email']}">{lang email}:</label></th>
										<td><input type="text" id="{$this->setting['reginput']['email']}" name="" autocomplete="off" size="25" tabindex="1" class="px" value="$hash[0]" /><br /><em id="emailmore">&nbsp;</em></td>
										<td class="tipcol"><i id="tip_{$this->setting['reginput']['email']}" class="p_tip">{lang dzapp_base:register_email_tips}</i><kbd id="chk_{$this->setting['reginput']['email']}" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
						<!--{/if}-->

						<!--{if $_GET[action] == 'activation'}-->
						<div id="activation_user" class="rfm">
							<table>
								<tr>
									<th>{lang username}:</th>
									<td><strong>$username</strong></td>
								</tr>
							</table>
						</div>
						<!--{/if}-->

						<!--{if $this->setting['regverify'] == 2}-->
						<div class="rfm">
							<table>
								<tr>
									<th><span class="rq">*</span><label for="regmessage">{lang register_message}:</label></th>
									<td><input id="regmessage" name="regmessage" class="px" autocomplete="off" size="25" tabindex="1" required /></td>
									<td class="tipcol"><i id="tip_regmessage" class="p_tip">{lang register_message1}</i></td>
								</tr>
							</table>
						</div>
						<!--{/if}-->

						<!--{if empty($invite) && $this->setting['regstatus'] == 3}-->
						<div class="rfm">
							<table>
								<tr>
									<th><label for="invitecode">{lang dzapp_base:invite_code}:</label></th>
									<td><input type="text" name="invitecode" autocomplete="off" size="25" id="invitecode"{if $this->setting['regstatus'] == 2} onblur="checkinvite()"{/if} tabindex="1" class="px" /></td>
								</tr>
							</table>
						</div>
						<!--{eval $invitecode = 1;}-->
						<!--{/if}-->

						<!--{loop $_G['cache']['fields_register'] $field}-->
							<!--{if $htmls[$field['fieldid']]}-->
							<div class="rfm">
								<table>
									<tr>
										<th><!--{if $field['required']}--><span class="rq">*</span><!--{/if}--><label for="$field['fieldid']">$field[title]:</label></th>
										<td>$htmls[$field['fieldid']]</td>
										<td class="tipcol"><i id="tip_$field['fieldid']" class="p_tip"><!--{if $field['description']}--><!--{echo dhtmlspecialchars($field[description])}--><!--{/if}--></i><kbd id="chk_$field['fieldid']" class="p_chk"></kbd></td>
									</tr>
								</table>
							</div>
							<!--{/if}-->
						<!--{/loop}-->
					<!--{/if}-->
					<!--{hook/register_input}-->

					<!--{if $secqaacheck || $seccodecheck}-->
						<!--{block sectpl}--><div class="rfm"><table><tr><th><span class="rq">*</span><sec>: </th><td><sec><br /><sec></td></tr></table></div><!--{/block}-->
						<!--{subtemplate common/seccheck}-->
					<!--{/if}-->

				</div>

			</div>

		</div>

		<div id="layer_reginfo_b">
			<div class="rfm mbw bw0">
				<table width="100%">
					<tr>
						<th>&nbsp;</th>
						<td>
							<span id="reginfo_a_btn">
								<!--{if $_GET[action] != 'activation'}--><em>&nbsp;</em><!--{/if}-->
									<button class="pn pnc" id="registerformsubmit" type="submit" name="regsubmit" value="true" tabindex="1"><strong>{lang dzapp_base:register_to_bind}</strong></button>
								<!--{if $bbrules}-->
									<input type="checkbox" class="pc" name="agreebbrule" value="$bbrulehash" id="agreebbrule" checked="checked" /> <label for="agreebbrule">{lang dzapp_base:agree}<a href="javascript:;" onclick="showBBRule()">{lang dzapp_base:rulemessage}</a></label>
								<!--{/if}-->
							</span>
						</td>
						<td><!--{if $this->setting['sitemessage'][register]}--><a href="javascript:;" id="custominfo_register" class="y"><img src="{IMGDIR}/info_small.gif" alt="{lang faq}" /></a><!--{/if}--></td>
					</tr>
				</table>
			</div>
			<!--{if !empty($_G['setting']['pluginhooks']['register_logging_method'])}-->
				<div class="rfm bw0 {if empty($_GET['infloat'])} mbw{/if}">
					<hr class="l" />
					<table>
						<tr>
							<th>{lang dzapp_base:login_method}:</th>
							<td><!--{hook/register_logging_method}--></td>
						</tr>
					</table>
				</div>
			<!--{/if}-->
		</div>
	</form>
<script type="text/javascript">
$('$_G[setting][reginput][username]').required = 0;
$('$_G[setting][reginput][password]').required = 0;
$('$_G[setting][reginput][password2]').required = 0;
$('$_G[setting][reginput][email]').required = 0;


<!--{if $_G[cache][plugin][dzapp_mobile][username]}-->
$('$_G[setting][reginput][username]').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
<!--{/if}-->
<!--{if $_G[cache][plugin][dzapp_mobile][email]}-->
$('$_G[setting][reginput][email]').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
<!--{/if}-->

var interval = 60;

function get_code() {
	var x = new Ajax();
	x.get('plugin.php?id=dzapp_mobile&mod=ajax&ac=code&type=reg&inajax=1&formhash={FORMHASH}&mobile=' + $('mobile').value, function(s) {
		$('tip_mobile').style.display = 'none';
		if(s == 'success') {
			$('$_G[setting][reginput][username]').value = '';
			$('chk_mobile').style.display = 'none';
			tmr_code();
		} else {
			$('chk_mobile').innerHTML = s;
		}
	});
}

function tmr_code() {
	$('codebtn').innerHTML = '<strong>{lang dzapp_mobile:sended}, ' + interval + '{lang dzapp_mobile:to_reget}</strong>';
	$('codebtn').disabled = true;
	interval --;
	if(interval > 0) {
		setTimeout('tmr_code()', 1000);
	} else {
		$('codebtn').innerHTML = '<strong>{lang dzapp_mobile:reget}</strong>';
		$('codebtn').disabled = false;
		interval = 60;
	}
}
</script>

	<!--{/if}-->
	<!--{eval $loginhash = 'L'.random(4);}-->
	<form method="post" autocomplete="off" name="login" id="loginform" class="cl" onsubmit="ajaxpost('loginform', 'returnmessage4', 'returnmessage4', 'onerror');return false;" action="plugin.php?id=dzapp_base&mod=bind&action=login&loginsubmit=yes{if !empty($_GET['handlekey'])}&handlekey=$_GET[handlekey]{/if}&loginhash=$loginhash" style="display: none">
		<div class="c cl bm_c">
			<input type="hidden" name="formhash" value="{FORMHASH}" />
			<input type="hidden" name="referer" value="{echo dreferer()}" />
			<div class="rfm">
				<table>
					<tr>
						<th>
						<!--{if $_G['setting']['autoidselect']}-->
							<label for="username">{lang login_id}:</label>
						<!--{else}-->
							<span class="login_slct">
								<select name="loginfield" style="float: left;" width="45" id="loginfield_$loginhash">
									<option value="username">{lang username}</option>
									<option value="uid">{lang uid}</option>
									<option value="email">{lang email}</option>
								</select>
							</span>
						<!--{/if}-->
						</th>
						<td><input type="text" name="username" id="username_$loginhash" autocomplete="off" size="36" class="txt" tabindex="1" value="$username" /></td>
					</tr>
				</table>
			</div>

			<div class="rfm">
				<table>
					<tr>
						<th><label for="password3_$loginhash">{lang login_password}:</label></th>
						<td><input type="password" id="password3_$loginhash" name="password" size="36" class="txt" tabindex="1" /></td>
					</tr>
				</table>
			</div>

			<div class="rfm">
				<table>
					<tr>
						<th>{lang security_q}:</th>
						<td><select id="loginquestionid_$loginhash" width="213" name="questionid" onchange="if($('loginquestionid_$loginhash').value > 0) $('loginanswer_row_$loginhash').style.display=''; else $('loginanswer_row_$loginhash').style.display='none'">
							<option value="0">{lang security_question}</option>
							<option value="1">{lang security_question_1}</option>
							<option value="2">{lang security_question_2}</option>
							<option value="3">{lang security_question_3}</option>
							<option value="4">{lang security_question_4}</option>
							<option value="5">{lang security_question_5}</option>
							<option value="6">{lang security_question_6}</option>
							<option value="7">{lang security_question_7}</option>
						</select></td>
					</tr>
				</table>
			</div>

			<div class="rfm" id="loginanswer_row_$loginhash" style="display:none">
				<table>
					<tr>
						<th>{lang security_a}:</th>
						<td><input type="text" name="answer" id="loginanswer_$loginhash" autocomplete="off" size="36" class="txt" tabindex="1" /></td>
					</tr>
				</table>
			</div>

		</div>
		<div class="rfm mbw bw0">
			<table>
				<tr>
					<th>&nbsp;</th>
					<td><button class="pn pnc" type="submit" name="loginsubmit" value="true" tabindex="1"><strong>{lang dzapp_base:login_to_bind}</strong></button></td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div id="layer_regmessage"class="f_c blr nfl" style="display: none">
	<div class="c"><div class="alert_right">
		<div id="messageleft1"></div>
		<p class="alert_btnleft" id="messageright1"></p>
	</div>
</div>

<div id="layer_bbrule" style="display: none">
<div class="c" style="width:700px;height:350px;overflow:auto">$bbrulestxt</div>
<p class="fsb pns cl hm">
	<button class="pn pnc" onclick="$('agreebbrule').checked = true;hideMenu('fwin_dialog', 'dialog');{if $this->setting['sitemessage'][register] && ($bbrules && $bbrulesforce)}showRegprompt();{/if}"><span>{lang dzapp_base:agree}</span></button>
	<button class="pn" onclick="location.href='$_G[siteurl]'"><span>{lang dzapp_base:disagree}</span></button>
</p>
</div>

<script type="text/javascript">
var ignoreEmail = <!--{if $_G['setting']['forgeemail']}-->true<!--{else}-->false<!--{/if}-->;
<!--{if $bbrules && $bbrulesforce}-->
	showBBRule();
<!--{/if}-->
<!--{if $this->showregisterform}-->
	<!--{if $sendurl}-->
	addMailEvent($('{$this->setting['reginput']['email']}'));
	<!--{else}-->
	addFormEvent('registerform', <!--{if $_GET[action] != 'activation' && !($bbrules && $bbrulesforce) && !empty($invitecode)}-->1<!--{else}-->0<!--{/if}-->);
	<!--{/if}-->
	<!--{if $this->setting['sitemessage'][register]}-->
		function showRegprompt() {
			showPrompt('custominfo_register', 'mouseover', '<!--{echo trim($this->setting['sitemessage'][register][array_rand($this->setting['sitemessage'][register])])}-->', $this->setting['sitemessage'][time]);
		}
		<!--{if !($bbrules && $bbrulesforce)}-->
			showRegprompt();
		<!--{/if}-->
	<!--{/if}-->
	function showBBRule() {
		showDialog($('layer_bbrule').innerHTML, 'info', '<!--{echo addslashes($this->setting['bbname']);}--> {lang dzapp_base:rulemessage}');
		$('fwin_dialog_close').style.display = 'none';
	}
<!--{/if}-->
simulateSelect('loginfield_$loginhash');
function switch_bind(type) {
	if(type == 1) {
		$('bind_1').className = 'a';$('bind_2').className = '';
		$('registerform').style.display = '';$('loginform').style.display = 'none';
	} else {
		$('bind_1').className = '';$('bind_2').className = 'a';
		$('registerform').style.display = 'none';$('loginform').style.display = '';
	}
}
</script>
	</div></div>
</div>

<!--{eval updatesession();}-->
<!--{template common/footer}-->